package org.bgstudio.sgs.Test;

import java.io.Serializable;

import java.util.Properties;

import java.sql.*;
import com.sun.sgs.app.*;
import org.bgstudio.sgs.querydata.QueryListener;
import org.bgstudio.sgs.querydata.QueryManager;

public class test implements Serializable, AppListener,QueryListener {

	private static final long serialVersionUID = 1L;

	@Override
	public void initialize(Properties props) {
		QueryManager qm = AppContext.getManager(QueryManager.class);

		ResultSet rs = qm
				.executeQuery("SELECT UID,codecard FROM members WHERE username='"
						+ "goolyuyi" + "'");
		//do sth with rs...
		
		qm.notifyQuery("SELECT UID,codecard FROM members WHERE username='"
						+ "goolyuyi" + "'",this)

	}

	@Override
	public ClientSessionListener loggedIn(ClientSession session) {
		return false;
	}

	void QueryResults(String sql,ResultSet results,int UpdateCount){
		//do sth with results...
	}
	void QueryException(String sql,SQLException e){
		//do sth with SQLException
	}

}
